﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Net;

namespace Daybreak.Core.Network
{
    public abstract class NetPacket
    {
        private byte[] data = new byte[0];

        public byte[] Data
        {
            get
            {
                return data;
            }
            set
            {
                data = value;
            }
        }

        private int client_id;

        internal int ClientID
        {
            get
            {
                return client_id;
            }
            set
            {
                client_id = value;
            }
        }

        private EndPoint rep;

        internal EndPoint RemoteEndPoint
        {
            get
            {
                return rep;
            }
            set
            {
                rep = value;
            }
        }

        private int id;

        internal int PacketID
        {
            get
            {
                return id;
            }
            set
            {
                id = value;
            }
        }

        /// <summary>
        /// function is called on the server side
        /// </summary>
        public abstract void ServerAction(ref NetBase server);

        /// <summary>
        /// function is called on the client side
        /// </summary>
        public abstract void ClientAction(ref NetBase client);

    }

}
